package com.bifang.common.constant.enums.common;

import org.apache.commons.lang3.StringUtils;

/** 任务类型 */
public enum TaskStatusEnum {
    init("初始化"),
    wait_claim("待签收"),
    wait_complete("待办"),
    finish("已办"),
    revoke("撤销");

    private String name; // 名称

    /**
     * 通过type获取Msg
     *
     * @param type
     * @return @Description:
     */
    public static String getEnumMsgByType(String type) {
        if (StringUtils.isBlank(type)) {
            return "";
        }
        for (TaskStatusEnum e : TaskStatusEnum.values()) {
            if (e.toString().equals(type)) {
                return e.name;
            }
        }
        return "";
    }

    private TaskStatusEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
